package com.atcc.test.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.atcc.test.domain.CollegeInfo;
import com.atcc.test.domain.StudentInfo;
import com.atcc.test.service.CollegeService;
import com.atcc.test.service.UserService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@RestController
@Api(value="测试Api",tags= {"查询学生信息"})
@RequestMapping("/student")
public class UserController {

	@Autowired
	UserService userService;
	
	@Autowired 
	CollegeService collegeService;
	
	@ApiOperation(value="根据名字查询学生信息",notes="根据名字查询学生信息")
	@GetMapping("/selectStuInfo/name")
	public StudentInfo selectStuInfoByName(@RequestParam("学生姓名")String name) {
		StudentInfo result =  userService.selectStuInfoByName(name);
		System.out.println(result);
		return result;
	}
	
	@ApiOperation(value="根据名字查询学生学校信息",notes="根据名字查询学生学校信息")
	@GetMapping("/selectColInfo/name")
	public CollegeInfo selectColInfoByName(@RequestParam("学生姓名")String name) {
		CollegeInfo result =  collegeService.selectColInfoByName(name);
		System.out.println(result);
		return result;
	}
}
